lib/repo-commit: Delay propagation of errors from abort_transaction()
authorPhilip Withnall <withnall@endlessm.com>
Thu, 14 Jun 2018 15:47:43 +0000 (16:47 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 14 Jun 2018 17:13:43 +0000 (17:13 +0000)
commit2d2f218669e6230edaf6329913a2b2c1cda590ed
tree63644dd4c1f98418068f5c10e5773898731bc631
parent31809d32f2268208a4f3e9e27b6882d39e4a75e0
lib/repo-commit: Delay propagation of errors from abort_transaction()

If there’s a problem while aborting a transaction, store the error but
don’t report it until the end of the function — do a best effort at
clearing the rest of the transaction state first (since most of it
cannot fail).

If cleanup_tmpdir() fails (which, arguably, should not be a
showstopper), this allows a caller to recover and start a new
transaction in future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1626
Approved by: jlebon
src/libostree/ostree-repo-commit.c